.class public Lcom/instagram/android/creation/activity/MediaCaptureActivity;
.super Lcom/instagram/android/fragment/do;
.source "MediaCaptureActivity.java"

# interfaces
.implements Lcom/instagram/creation/base/a;
.implements Lcom/instagram/creation/base/b;
.implements Lcom/instagram/creation/photo/a/a;
.implements Lcom/instagram/creation/photo/crop/i;
.implements Lcom/instagram/creation/video/i/a;
.implements Lcom/instagram/pendingmedia/model/f;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 43
    invoke-direct {p0}, Lcom/instagram/android/fragment/do;-><init>()V

    return-void
.end method

.method private b(Ljava/lang/String;Landroid/os/Bundle;)V
    .locals 3
    .parameter
    .parameter

    .prologue
    .line 150
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0, p2}, Landroid/os/Bundle;-><init>(Landroid/os/Bundle;)V

    .line 153
    const-string v1, "mediaSource"

    invoke-direct {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->j()I

    move-result v2

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 154
    const-string v1, "mediaFilePath"

    invoke-virtual {v0, v1, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 156
    new-instance v1, Lcom/instagram/e/b/a/a;

    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->f()Landroid/support/v4/app/r;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/instagram/e/b/a/a;-><init>(Landroid/support/v4/app/r;)V

    new-instance v2, Lcom/instagram/android/creation/b/al;

    invoke-direct {v2}, Lcom/instagram/android/creation/b/al;-><init>()V

    invoke-static {v0}, Lcom/instagram/android/creation/b/br;->a(Landroid/os/Bundle;)Landroid/os/Bundle;

    move-result-object v0

    invoke-virtual {v1, v2, v0}, Lcom/instagram/e/b/a/a;->a(Landroid/support/v4/app/Fragment;Landroid/os/Bundle;)Lcom/instagram/e/b/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/e/b/a/a;->e()V

    .line 159
    return-void
.end method

.method private j()I
    .locals 3

    .prologue
    .line 162
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "mediaSource"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    return v0
.end method

.method private k()Z
    .locals 3

    .prologue
    .line 245
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const-string v1, "directShare"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method


# virtual methods
.method public a(Lcom/instagram/creation/base/c;Z)V
    .locals 4
    .parameter
    .parameter

    .prologue
    .line 210
    new-instance v1, Landroid/os/Bundle;

    invoke-direct {v1}, Landroid/os/Bundle;-><init>()V

    .line 211
    const-string v0, "directShare"

    invoke-virtual {v1, v0, p2}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    .line 213
    sget-object v0, Lcom/instagram/creation/base/c;->b:Lcom/instagram/creation/base/c;

    if-ne p1, v0, :cond_0

    new-instance v0, Lcom/instagram/creation/video/f/a;

    invoke-direct {v0}, Lcom/instagram/creation/video/f/a;-><init>()V

    .line 216
    :goto_0
    new-instance v2, Lcom/instagram/e/b/a/a;

    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->f()Landroid/support/v4/app/r;

    move-result-object v3

    invoke-direct {v2, v3}, Lcom/instagram/e/b/a/a;-><init>(Landroid/support/v4/app/r;)V

    invoke-virtual {v2, v0, v1}, Lcom/instagram/e/b/a/a;->a(Landroid/support/v4/app/Fragment;Landroid/os/Bundle;)Lcom/instagram/e/b/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/e/b/a/a;->f()Lcom/instagram/e/b/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/e/b/a/a;->e()V

    .line 220
    return-void

    .line 213
    :cond_0
    new-instance v0, Lcom/instagram/android/creation/b/a;

    invoke-direct {v0}, Lcom/instagram/android/creation/b/a;-><init>()V

    goto :goto_0
.end method

.method public a(Lcom/instagram/pendingmedia/model/c;)V
    .locals 0
    .parameter

    .prologue
    .line 190
    invoke-static {p0, p1}, Lcom/instagram/android/service/PendingMediaService;->b(Landroid/content/Context;Lcom/instagram/pendingmedia/model/c;)V

    .line 191
    return-void
.end method

.method public a(Ljava/lang/Runnable;)V
    .locals 1
    .parameter

    .prologue
    .line 168
    invoke-static {}, Lcom/instagram/pendingmedia/b/c;->a()Lcom/instagram/pendingmedia/b/c;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/instagram/pendingmedia/b/c;->a(Ljava/lang/Runnable;)V

    .line 169
    return-void
.end method

.method public a(Ljava/lang/String;Landroid/os/Bundle;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 140
    invoke-direct {p0, p1, p2}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->b(Ljava/lang/String;Landroid/os/Bundle;)V

    .line 141
    return-void
.end method

.method public a(Ljava/lang/String;Z)V
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 224
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    invoke-virtual {p0, p1, p2, v0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->a(Ljava/lang/String;ZLandroid/os/Bundle;)V

    .line 225
    return-void
.end method

.method public a(Ljava/lang/String;ZLandroid/os/Bundle;)V
    .locals 2
    .parameter
    .parameter
    .parameter

    .prologue
    .line 229
    const-string v0, "pendingMediaKey"

    invoke-virtual {p3, v0, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 230
    const-string v0, "directShare"

    invoke-virtual {p3, v0, p2}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    .line 231
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->f()Landroid/support/v4/app/r;

    move-result-object v0

    .line 235
    invoke-virtual {v0}, Landroid/support/v4/app/r;->c()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 236
    new-instance v1, Lcom/instagram/e/b/a/a;

    invoke-direct {v1, v0}, Lcom/instagram/e/b/a/a;-><init>(Landroid/support/v4/app/r;)V

    new-instance v0, Lcom/instagram/android/creation/b/cg;

    invoke-direct {v0}, Lcom/instagram/android/creation/b/cg;-><init>()V

    invoke-virtual {v1, v0, p3}, Lcom/instagram/e/b/a/a;->a(Landroid/support/v4/app/Fragment;Landroid/os/Bundle;)Lcom/instagram/e/b/a/a;

    move-result-object v0

    const-string v1, "next"

    invoke-virtual {v0, v1}, Lcom/instagram/e/b/a/a;->e(Ljava/lang/String;)Lcom/instagram/e/b/a/a;

    move-result-object v0

    const-string v1, "METADATA_FRAGMENT"

    invoke-virtual {v0, v1}, Lcom/instagram/e/b/a/a;->d(Ljava/lang/String;)Lcom/instagram/e/b/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/e/b/a/a;->e()V

    .line 242
    :cond_0
    return-void
.end method

.method public b(Lcom/instagram/pendingmedia/model/c;)V
    .locals 0
    .parameter

    .prologue
    .line 195
    invoke-static {p0, p1}, Lcom/instagram/android/service/PendingMediaService;->a(Landroid/content/Context;Lcom/instagram/pendingmedia/model/c;)V

    .line 196
    return-void
.end method

.method public c(Lcom/instagram/pendingmedia/model/c;)V
    .locals 0
    .parameter

    .prologue
    .line 200
    invoke-static {p0, p1}, Lcom/instagram/android/service/PendingMediaService;->d(Landroid/content/Context;Lcom/instagram/pendingmedia/model/c;)V

    .line 201
    return-void
.end method

.method public h()V
    .locals 0

    .prologue
    .line 145
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->onBackPressed()V

    .line 146
    return-void
.end method

.method public i()V
    .locals 1

    .prologue
    .line 205
    new-instance v0, Lcom/instagram/android/service/o;

    invoke-direct {v0, p0}, Lcom/instagram/android/service/o;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0}, Lcom/instagram/android/service/o;->a()V

    .line 206
    return-void
.end method

.method public onBackPressed()V
    .locals 4

    .prologue
    const/4 v2, 0x1

    const/4 v1, 0x0

    .line 173
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->f()Landroid/support/v4/app/r;

    move-result-object v0

    sget v3, Lcom/facebook/aw;->layout_container_main:I

    invoke-virtual {v0, v3}, Landroid/support/v4/app/r;->a(I)Landroid/support/v4/app/Fragment;

    move-result-object v0

    .line 177
    instance-of v3, v0, Lcom/instagram/creation/video/f/a;

    if-eqz v3, :cond_3

    .line 178
    check-cast v0, Lcom/instagram/creation/video/f/a;

    invoke-virtual {v0}, Lcom/instagram/creation/video/f/a;->aa()Z

    move-result v0

    if-eqz v0, :cond_2

    move v0, v2

    :goto_0
    move v1, v0

    .line 183
    :cond_0
    :goto_1
    if-nez v1, :cond_1

    .line 184
    invoke-super {p0}, Lcom/instagram/android/fragment/do;->onBackPressed()V

    .line 186
    :cond_1
    return-void

    :cond_2
    move v0, v1

    .line 178
    goto :goto_0

    .line 179
    :cond_3
    instance-of v3, v0, Lcom/instagram/android/creation/b/al;

    if-eqz v3, :cond_0

    .line 180
    check-cast v0, Lcom/instagram/android/creation/b/al;

    invoke-virtual {v0}, Lcom/instagram/android/creation/b/al;->Z()Z

    move-result v0

    if-eqz v0, :cond_0

    move v1, v2

    goto :goto_1
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 6
    .parameter "savedInstanceState"

    .prologue
    const/4 v5, 0x0

    .line 55
    invoke-super {p0, p1}, Lcom/instagram/android/fragment/do;->onCreate(Landroid/os/Bundle;)V

    .line 57
    invoke-static {}, Lcom/instagram/service/a;->a()Lcom/instagram/service/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/service/a;->d()Z

    move-result v0

    if-nez v0, :cond_0

    .line 58
    invoke-static {p0}, Lcom/instagram/android/activity/a;->a(Landroid/app/Activity;)V

    .line 61
    :cond_0
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getWindow()Landroid/view/Window;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/view/Window;->setFormat(I)V

    .line 62
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getWindow()Landroid/view/Window;

    move-result-object v0

    const/16 v1, 0x1000

    invoke-virtual {v0, v1}, Landroid/view/Window;->addFlags(I)V

    .line 64
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/instagram/camera/h;->a(Landroid/view/Window;Landroid/content/ContentResolver;)V

    .line 66
    sget v0, Lcom/facebook/ax;->activity_capture:I

    invoke-virtual {p0, v0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->setContentView(I)V

    .line 68
    invoke-static {}, Lcom/instagram/android/service/q;->e()J

    move-result-wide v0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    cmp-long v0, v0, v2

    if-gez v0, :cond_1

    .line 70
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/instagram/android/service/UserService;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 71
    const-string v1, "suggestions"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    .line 72
    invoke-virtual {p0, v0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 76
    :cond_1
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    .line 77
    invoke-virtual {v1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v2

    .line 79
    const-string v0, "isCrop"

    invoke-virtual {v1, v0}, Landroid/content/Intent;->hasExtra(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    .line 80
    new-instance v0, Lcom/instagram/creation/photo/crop/a;

    invoke-direct {v0}, Lcom/instagram/creation/photo/crop/a;-><init>()V

    .line 81
    invoke-virtual {v1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/support/v4/app/Fragment;->g(Landroid/os/Bundle;)V

    .line 127
    :cond_2
    :goto_0
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->f()Landroid/support/v4/app/r;

    move-result-object v1

    .line 128
    sget v2, Lcom/facebook/aw;->layout_container_main:I

    invoke-virtual {v1, v2}, Landroid/support/v4/app/r;->a(I)Landroid/support/v4/app/Fragment;

    move-result-object v1

    .line 129
    if-nez v1, :cond_3

    .line 130
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->f()Landroid/support/v4/app/r;

    move-result-object v1

    invoke-virtual {v1}, Landroid/support/v4/app/r;->a()Landroid/support/v4/app/af;

    move-result-object v1

    .line 131
    sget v2, Lcom/facebook/aw;->layout_container_main:I

    const-string v3, "MediaCaptureActivity"

    invoke-virtual {v1, v2, v0, v3}, Landroid/support/v4/app/af;->b(ILandroid/support/v4/app/Fragment;Ljava/lang/String;)Landroid/support/v4/app/af;

    .line 132
    invoke-virtual {v1}, Landroid/support/v4/app/af;->a()I

    .line 134
    :cond_3
    :goto_1
    return-void

    .line 82
    :cond_4
    const-string v0, "videoFilePath"

    invoke-virtual {v1, v0}, Landroid/content/Intent;->hasExtra(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_7

    .line 83
    const-string v0, "videoFilePath"

    invoke-virtual {v1, v0}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Landroid/net/Uri;

    .line 85
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1, v0}, Lcom/instagram/creation/video/j/j;->a(Landroid/content/Context;Landroid/net/Uri;)Ljava/lang/String;

    move-result-object v0

    .line 86
    const-string v1, "video_invalid_url"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_6

    .line 87
    invoke-static {v0}, Lcom/instagram/creation/video/g/a;->a(Ljava/lang/String;)Lcom/instagram/creation/video/g/a;

    move-result-object v0

    .line 88
    invoke-static {v0}, Lcom/instagram/creation/video/j/j;->a(Lcom/instagram/creation/video/g/a;)Z

    move-result v1

    if-eqz v1, :cond_5

    .line 89
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->j()I

    move-result v2

    invoke-static {v1, v2}, Lcom/instagram/creation/video/j/j;->a(Landroid/content/Context;I)Lcom/instagram/pendingmedia/model/c;

    move-result-object v1

    .line 91
    invoke-static {}, Lcom/instagram/pendingmedia/b/a;->a()Lcom/instagram/pendingmedia/b/a;

    move-result-object v2

    invoke-virtual {v1}, Lcom/instagram/pendingmedia/model/c;->a()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v1}, Lcom/instagram/pendingmedia/b/a;->a(Ljava/lang/String;Lcom/instagram/pendingmedia/model/c;)V

    .line 92
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->f()Landroid/support/v4/app/r;

    move-result-object v2

    invoke-virtual {v1}, Lcom/instagram/pendingmedia/model/c;->a()Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->k()Z

    move-result v3

    invoke-static {v2, v1, v0, v5, v3}, Lcom/instagram/creation/video/j/j;->a(Landroid/support/v4/app/r;Ljava/lang/String;Lcom/instagram/creation/video/g/a;ZZ)V

    goto :goto_1

    .line 100
    :cond_5
    invoke-virtual {p0}, Lcom/instagram/android/creation/activity/MediaCaptureActivity;->finish()V

    goto :goto_1

    .line 103
    :cond_6
    invoke-static {p0}, Lcom/instagram/creation/video/j/j;->a(Landroid/app/Activity;)V

    goto :goto_1

    .line 106
    :cond_7
    const-string v0, "mediaFilePath"

    invoke-virtual {v1, v0}, Landroid/content/Intent;->hasExtra(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_8

    .line 107
    new-instance v0, Lcom/instagram/android/creation/b/al;

    invoke-direct {v0}, Lcom/instagram/android/creation/b/al;-><init>()V

    .line 108
    invoke-static {v2}, Lcom/instagram/android/creation/b/br;->a(Landroid/os/Bundle;)Landroid/os/Bundle;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/support/v4/app/Fragment;->g(Landroid/os/Bundle;)V

    goto/16 :goto_0

    .line 111
    :cond_8
    invoke-static {}, Lcom/instagram/pendingmedia/b/a;->a()Lcom/instagram/pendingmedia/b/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/pendingmedia/b/a;->d()Lcom/instagram/pendingmedia/model/c;

    move-result-object v0

    .line 112
    if-eqz v0, :cond_9

    .line 113
    new-instance v0, Lcom/instagram/creation/video/f/a;

    invoke-direct {v0}, Lcom/instagram/creation/video/f/a;-><init>()V

    .line 117
    :goto_2
    const-string v2, "directShare"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->hasExtra(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 118
    new-instance v2, Landroid/os/Bundle;

    invoke-direct {v2}, Landroid/os/Bundle;-><init>()V

    .line 119
    const-string v3, "directShare"

    const-string v4, "directShare"

    invoke-virtual {v1, v4, v5}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v1

    invoke-virtual {v2, v3, v1}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    .line 123
    invoke-virtual {v0, v2}, Landroid/support/v4/app/Fragment;->g(Landroid/os/Bundle;)V

    goto/16 :goto_0

    .line 115
    :cond_9
    new-instance v0, Lcom/instagram/android/creation/b/a;

    invoke-direct {v0}, Lcom/instagram/android/creation/b/a;-><init>()V

    goto :goto_2
.end method
